<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>从小到大排列</title>
</head>
<body>
<script>
  var array = [66, 33, 78, 98, 88, 99];
  alert("排序前的数组: " + array);

  var n = array.length;
  for (var i = 0; i < n; i++) {
    for (var j = 0; j < n - i - 1; j++) {
      if (array[j] > array[j+1]) {
        var temp = array[j];
        array[j] = array[j+1];
        array[j+1] = temp;
      }
    }
  }

  alert("排序后的数组: " + array);
</script>
</body>
</html>